package pers.xiaoliang.concurrency.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.Jedis;

/**
* @description: Redis配置
* @author: xiaoliang.liu
* @date: 2018/7/29 17:15
* @version v1.0
*/
@Configuration
public class RedisConfig {
    /**
     * 单节点redis操作对象bean
     * @param host 地址
     * @param port 端口
     * @return 单节点redis操作对象
     */
    @Bean
    public Jedis getJedis(@Value("${redis.host}") String host, @Value("${redis.port}") int port) {
        return new Jedis(host, port);
    }
}
